package com.hlhj.funlike_business.activity.adapter;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

public class FgmPagerAdp extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    public FgmPagerAdp(List<Fragment> fragments,FragmentManager fm) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        switch (position){
            case 0:
                return "全部订单";
            case 1:
                return "待接单";
            case 2:
                return "待配送";
            case 3:
                return "已完成";
            case 4:
                return "退单";
        }
        return "";
    }
}
